﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevComponents.DotNetBar;

namespace QuanLyHangXeKhach
{
    public partial class frmKhachHangTraCuu : DevComponents.DotNetBar.Controls.SlidePanel
    {
        public frmKhachHangTraCuu()
        {
            InitializeComponent();

            
        }

        protected override void OnResize(EventArgs e)
        {
            // Center the panel
            itemPanel1.Location = new Point((this.Width - itemPanel1.Width) / 2 + 16, ((this.Height - 16) - itemPanel1.Height) / 2 );
            base.OnResize(e);
        }

        #region Điều khiển đóng/mở form
        private DieuKhien _Commands;
        /// <summary>
        /// Gets or sets the commands associated with the control.
        /// </summary>
        public DieuKhien Commands
        {
            get { return _Commands; }
            set
            {
                if (value != _Commands)
                {
                    DieuKhien oldValue = _Commands;
                    _Commands = value;
                    OnCommandsChanged(oldValue, value);
                }
            }
        }
        /// <summary>
        /// Called when Commands property has changed.
        /// </summary>
        /// <param name="oldValue">Old property value</param>
        /// <param name="newValue">New property value</param>
        protected virtual void OnCommandsChanged(DieuKhien oldValue, DieuKhien newValue)
        {
            if (newValue != null)
            {
                btntracuu.Command = newValue.TraCuuDatVe;
                btnthongtin.Command = newValue.ThongTinTuyenDuong;
                btndangnhap.Command = newValue.DangNhap;
            }
            else
            {
                btntracuu.Command = null;
                btnthongtin.Command = null;
                btndangnhap.Command = null;
            }
        }

        #endregion
    }
}
